import { createWebHashHistory, createRouter } from "vue-router";
import Layout from '@/views/Layout.vue';
import Home from '@/views/Home/Home.vue'

const Login = () => import('@/views/Login.vue');
const category = () => import('@/views/category/Category.vue')

const routes = [
    {
        path:'/',
        name: 'Layout',
        component: Layout,
        children: [
            {
                path: '',
                component: Home
            },
            {
                path: '/category/:id',
                component: category
            }
        ]
    },
    {
        path:'/login',
        name: 'Login',
        component: Login
    }
]

const router = createRouter({
    // Hash模式
    history: createWebHashHistory(),
    routes: routes
})

export default router